Ext.define('tuan.view.donhang.ChooseProduct',{
	extend : 'Ext.grid.Panel',
	xtype : 'choose_product_xtype',
	itemId : 'cho',
	width : '100%',
	  height : 160,
    xtype : 'choose_product_detail_gird',
        plugins : [
 	{
		ptype : "rowediting",
		clicksToEdit : 1
 	}
	],
    columns : [
    {
      header : "Tên sản phẩm",
      dataIndex : "product_name",
      flex:2
  },
  {
      header : "Giá",
      dataIndex : "price",
      flex:2,
      xtype: 'numbercolumn',
      renderer : function(value){
         return Ext.util.Format.currency(value, 'VND ')
     }
 },
  {
  header : "Trọng lượng (Kg)",
  dataIndex : "weight",
  flex:2,
  renderer : function(value){
     return value + ' kg'
 }
},
{
	  		header : "Category",
		  	dataIndex : "cate_id",
		  	flex:3,
		  	renderer: function (value, metaData, record, row, col, store, gridView) {
			    // var name = 'Loading..';
			    var c = JSON.parse(localStorage.getItem('localStoreCates'));

			    for (var index in c) {
			        if(value === c[index].id){
			            name = c[index].catename
			        }
			    };
		    	return name;
			}
		},
		{
			header : 'Quantity',
			dataIndex : 'quantity',
			flex : 2,
						editor : {
				xtype : "numberfield"
			}
		}
    ]

})